/*
               File: PrcReuniao
        Description: Prc Reuniao
             Author: GeneXus C# Generator version 10_2_5-78484
       Generated on: 6/6/2014 9:52:42.49
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using System.Data;
using System.Data.SqlClient;
using GeneXus.Data;
using com.genexus;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.WebControls;
using GeneXus.Http;
using GeneXus.Procedure;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Threading;
using System.Xml.Serialization;
using System.Data.SqlTypes;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace GeneXus.Programs {
   public class prcreuniao : GXProcedure
   {
      public prcreuniao( )
      {
         context = new GxContext(  );
         DataStoreUtil.LoadDataStores( context);
         dsDefault = context.GetDataStore("Default");
         IsMain = true;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public prcreuniao( IGxContext context )
      {
         this.context = context;
         IsMain = false;
         dsDefault = context.GetDataStore("Default");
      }

      public void release( )
      {
      }

      public void execute( ref String aP0_ReuniaoAssunto ,
                           ref String aP1_ReuniaoAta ,
                           ref DateTime aP2_ReuniaoData ,
                           ref int aP3_ReuniaoId ,
                           ref String aP4_ReuniaoLocal ,
                           ref String aP5_ReuniaoNivel ,
                           ref String aP6_ReuniaoObs ,
                           ref String aP7_ReuniaoPalavra ,
                           ref short aP8_ReuniaoUserCID ,
                           out int aP9_AuxReuniaoId )
      {
         this.AV8ReuniaoAssunto = aP0_ReuniaoAssunto;
         this.AV9ReuniaoAta = aP1_ReuniaoAta;
         this.AV10ReuniaoData = aP2_ReuniaoData;
         this.AV11ReuniaoId = aP3_ReuniaoId;
         this.AV12ReuniaoLocal = aP4_ReuniaoLocal;
         this.AV13ReuniaoNivel = aP5_ReuniaoNivel;
         this.AV14ReuniaoObs = aP6_ReuniaoObs;
         this.AV15ReuniaoPalavra = aP7_ReuniaoPalavra;
         this.AV16ReuniaoUserCID = aP8_ReuniaoUserCID;
         this.AV17AuxReuniaoId = 0 ;
         initialize();
         executePrivate();
         aP0_ReuniaoAssunto=this.AV8ReuniaoAssunto;
         aP1_ReuniaoAta=this.AV9ReuniaoAta;
         aP2_ReuniaoData=this.AV10ReuniaoData;
         aP3_ReuniaoId=this.AV11ReuniaoId;
         aP4_ReuniaoLocal=this.AV12ReuniaoLocal;
         aP5_ReuniaoNivel=this.AV13ReuniaoNivel;
         aP6_ReuniaoObs=this.AV14ReuniaoObs;
         aP7_ReuniaoPalavra=this.AV15ReuniaoPalavra;
         aP8_ReuniaoUserCID=this.AV16ReuniaoUserCID;
         aP9_AuxReuniaoId=this.AV17AuxReuniaoId;
      }

      public int executeUdp( ref String aP0_ReuniaoAssunto ,
                             ref String aP1_ReuniaoAta ,
                             ref DateTime aP2_ReuniaoData ,
                             ref int aP3_ReuniaoId ,
                             ref String aP4_ReuniaoLocal ,
                             ref String aP5_ReuniaoNivel ,
                             ref String aP6_ReuniaoObs ,
                             ref String aP7_ReuniaoPalavra ,
                             ref short aP8_ReuniaoUserCID )
      {
         this.AV8ReuniaoAssunto = aP0_ReuniaoAssunto;
         this.AV9ReuniaoAta = aP1_ReuniaoAta;
         this.AV10ReuniaoData = aP2_ReuniaoData;
         this.AV11ReuniaoId = aP3_ReuniaoId;
         this.AV12ReuniaoLocal = aP4_ReuniaoLocal;
         this.AV13ReuniaoNivel = aP5_ReuniaoNivel;
         this.AV14ReuniaoObs = aP6_ReuniaoObs;
         this.AV15ReuniaoPalavra = aP7_ReuniaoPalavra;
         this.AV16ReuniaoUserCID = aP8_ReuniaoUserCID;
         this.AV17AuxReuniaoId = 0 ;
         initialize();
         executePrivate();
         aP0_ReuniaoAssunto=this.AV8ReuniaoAssunto;
         aP1_ReuniaoAta=this.AV9ReuniaoAta;
         aP2_ReuniaoData=this.AV10ReuniaoData;
         aP3_ReuniaoId=this.AV11ReuniaoId;
         aP4_ReuniaoLocal=this.AV12ReuniaoLocal;
         aP5_ReuniaoNivel=this.AV13ReuniaoNivel;
         aP6_ReuniaoObs=this.AV14ReuniaoObs;
         aP7_ReuniaoPalavra=this.AV15ReuniaoPalavra;
         aP8_ReuniaoUserCID=this.AV16ReuniaoUserCID;
         aP9_AuxReuniaoId=this.AV17AuxReuniaoId;
         return AV17AuxReuniaoId ;
      }

      public void executeSubmit( ref String aP0_ReuniaoAssunto ,
                                 ref String aP1_ReuniaoAta ,
                                 ref DateTime aP2_ReuniaoData ,
                                 ref int aP3_ReuniaoId ,
                                 ref String aP4_ReuniaoLocal ,
                                 ref String aP5_ReuniaoNivel ,
                                 ref String aP6_ReuniaoObs ,
                                 ref String aP7_ReuniaoPalavra ,
                                 ref short aP8_ReuniaoUserCID ,
                                 out int aP9_AuxReuniaoId )
      {
         prcreuniao objprcreuniao;
         objprcreuniao = new prcreuniao();
         objprcreuniao.AV8ReuniaoAssunto = aP0_ReuniaoAssunto;
         objprcreuniao.AV9ReuniaoAta = aP1_ReuniaoAta;
         objprcreuniao.AV10ReuniaoData = aP2_ReuniaoData;
         objprcreuniao.AV11ReuniaoId = aP3_ReuniaoId;
         objprcreuniao.AV12ReuniaoLocal = aP4_ReuniaoLocal;
         objprcreuniao.AV13ReuniaoNivel = aP5_ReuniaoNivel;
         objprcreuniao.AV14ReuniaoObs = aP6_ReuniaoObs;
         objprcreuniao.AV15ReuniaoPalavra = aP7_ReuniaoPalavra;
         objprcreuniao.AV16ReuniaoUserCID = aP8_ReuniaoUserCID;
         objprcreuniao.AV17AuxReuniaoId = 0 ;
         objprcreuniao.context.SetSubmitInitialConfig(context);
         objprcreuniao.initialize();
         ThreadPool.QueueUserWorkItem( new WaitCallback( executePrivateCatch ),objprcreuniao);
         aP0_ReuniaoAssunto=this.AV8ReuniaoAssunto;
         aP1_ReuniaoAta=this.AV9ReuniaoAta;
         aP2_ReuniaoData=this.AV10ReuniaoData;
         aP3_ReuniaoId=this.AV11ReuniaoId;
         aP4_ReuniaoLocal=this.AV12ReuniaoLocal;
         aP5_ReuniaoNivel=this.AV13ReuniaoNivel;
         aP6_ReuniaoObs=this.AV14ReuniaoObs;
         aP7_ReuniaoPalavra=this.AV15ReuniaoPalavra;
         aP8_ReuniaoUserCID=this.AV16ReuniaoUserCID;
         aP9_AuxReuniaoId=this.AV17AuxReuniaoId;
      }

      void executePrivateCatch( object stateInfo )
      {
         try
         {
            ((prcreuniao)stateInfo).executePrivate();
         }
         catch ( Exception e )
         {
            GXUtil.SaveToEventLog( "Design", e);
            throw e ;
         }
      }

      void executePrivate( )
      {
         /* GeneXus formulas */
         /* Output device settings */
         if ( (0==AV11ReuniaoId) )
         {
            /*
               INSERT RECORD ON TABLE TBLReuniao

            */
            A27ReuniaoAssunto = AV8ReuniaoAssunto;
            A28ReuniaoAta = AV9ReuniaoAta;
            A23ReuniaoData = AV10ReuniaoData;
            A25ReuniaoLocal = AV12ReuniaoLocal;
            A31ReuniaoNivel = AV13ReuniaoNivel;
            A26ReuniaoObs = AV14ReuniaoObs;
            A24ReuniaoPalavra = AV15ReuniaoPalavra;
            A40ReuniaoUserCID = AV16ReuniaoUserCID;
            /* Using cursor P00062 */
            A30ReuniaoAtaFileName = FileUtil.GetFileName( A28ReuniaoAta);
            A29ReuniaoAtaFileType = FileUtil.GetFileType( A28ReuniaoAta);
            pr_default.execute(0, new Object[] {A23ReuniaoData, A24ReuniaoPalavra, A25ReuniaoLocal, A26ReuniaoObs, A40ReuniaoUserCID, A27ReuniaoAssunto, A28ReuniaoAta, A31ReuniaoNivel, A30ReuniaoAtaFileName, A29ReuniaoAtaFileType});
            pr_default.close(0);
            /* Retrieving last key number assigned */
            /* Using cursor P00063 */
            pr_default.execute(1);
            A22ReuniaoId = P00063_A22ReuniaoId[0];
            n22ReuniaoId = P00063_n22ReuniaoId[0];
            pr_default.close(1);
            dsDefault.SmartCacheProvider.SetUpdated("TBLReuniao") ;
            if ( (pr_default.getStatus(0) == 1) )
            {
               context.Gx_err = 1;
               Gx_emsg = (String)(context.GetMessage( "GXM_noupdate", ""));
            }
            else
            {
               context.Gx_err = 0;
               Gx_emsg = "";
            }
            /* End Insert */
            /* Using cursor P00064 */
            pr_default.execute(2, new Object[] {AV8ReuniaoAssunto, AV10ReuniaoData});
            while ( (pr_default.getStatus(2) != 101) )
            {
               A23ReuniaoData = P00064_A23ReuniaoData[0];
               A27ReuniaoAssunto = P00064_A27ReuniaoAssunto[0];
               A22ReuniaoId = P00064_A22ReuniaoId[0];
               n22ReuniaoId = P00064_n22ReuniaoId[0];
               AV17AuxReuniaoId = A22ReuniaoId;
               pr_default.readNext(2);
            }
            pr_default.close(2);
         }
         else
         {
            /* Using cursor P00065 */
            pr_default.execute(3, new Object[] {AV11ReuniaoId});
            while ( (pr_default.getStatus(3) != 101) )
            {
               A22ReuniaoId = P00065_A22ReuniaoId[0];
               n22ReuniaoId = P00065_n22ReuniaoId[0];
               A30ReuniaoAtaFileName = P00065_A30ReuniaoAtaFileName[0];
               A29ReuniaoAtaFileType = P00065_A29ReuniaoAtaFileType[0];
               A27ReuniaoAssunto = P00065_A27ReuniaoAssunto[0];
               A23ReuniaoData = P00065_A23ReuniaoData[0];
               A25ReuniaoLocal = P00065_A25ReuniaoLocal[0];
               A31ReuniaoNivel = P00065_A31ReuniaoNivel[0];
               A26ReuniaoObs = P00065_A26ReuniaoObs[0];
               A24ReuniaoPalavra = P00065_A24ReuniaoPalavra[0];
               A40ReuniaoUserCID = P00065_A40ReuniaoUserCID[0];
               A28ReuniaoAta = P00065_A28ReuniaoAta[0];
               A27ReuniaoAssunto = AV8ReuniaoAssunto;
               A28ReuniaoAta = AV9ReuniaoAta;
               A23ReuniaoData = AV10ReuniaoData;
               A25ReuniaoLocal = AV12ReuniaoLocal;
               A31ReuniaoNivel = AV13ReuniaoNivel;
               A26ReuniaoObs = AV14ReuniaoObs;
               A24ReuniaoPalavra = AV15ReuniaoPalavra;
               A40ReuniaoUserCID = AV16ReuniaoUserCID;
               /* Using cursor P00066 */
               A29ReuniaoAtaFileType = FileUtil.GetFileType( A28ReuniaoAta);
               A30ReuniaoAtaFileName = FileUtil.GetFileName( A28ReuniaoAta);
               pr_default.execute(4, new Object[] {A27ReuniaoAssunto, A28ReuniaoAta, A23ReuniaoData, A25ReuniaoLocal, A31ReuniaoNivel, A26ReuniaoObs, A24ReuniaoPalavra, A40ReuniaoUserCID, A29ReuniaoAtaFileType, A30ReuniaoAtaFileName, n22ReuniaoId, A22ReuniaoId});
               pr_default.close(4);
               dsDefault.SmartCacheProvider.SetUpdated("TBLReuniao") ;
               /* Exiting from a For First loop. */
               if (true) break;
            }
            pr_default.close(3);
         }
         this.cleanup();
      }

      public void cleanup( )
      {
         context.CommitDataStores("PrcReuniao");
         CloseOpenCursors();
         if ( IsMain )
         {
            context.CloseConnections() ;
         }
         exitApplication();
      }

      protected void CloseOpenCursors( )
      {
      }

      public override void initialize( )
      {
         A27ReuniaoAssunto = "";
         A28ReuniaoAta = "";
         A23ReuniaoData = DateTime.MinValue;
         A25ReuniaoLocal = "";
         A31ReuniaoNivel = "";
         A26ReuniaoObs = "";
         A24ReuniaoPalavra = "";
         A30ReuniaoAtaFileName = "";
         A29ReuniaoAtaFileType = "";
         scmdbuf = "";
         P00063_A22ReuniaoId = new int[1] ;
         P00063_n22ReuniaoId = new bool[] {false} ;
         Gx_emsg = "";
         P00064_A23ReuniaoData = new DateTime[] {DateTime.MinValue} ;
         P00064_A27ReuniaoAssunto = new String[] {""} ;
         P00064_A22ReuniaoId = new int[1] ;
         P00064_n22ReuniaoId = new bool[] {false} ;
         P00065_A22ReuniaoId = new int[1] ;
         P00065_n22ReuniaoId = new bool[] {false} ;
         P00065_A30ReuniaoAtaFileName = new String[] {""} ;
         P00065_A29ReuniaoAtaFileType = new String[] {""} ;
         P00065_A27ReuniaoAssunto = new String[] {""} ;
         P00065_A23ReuniaoData = new DateTime[] {DateTime.MinValue} ;
         P00065_A25ReuniaoLocal = new String[] {""} ;
         P00065_A31ReuniaoNivel = new String[] {""} ;
         P00065_A26ReuniaoObs = new String[] {""} ;
         P00065_A24ReuniaoPalavra = new String[] {""} ;
         P00065_A40ReuniaoUserCID = new short[1] ;
         P00065_A28ReuniaoAta = new String[] {""} ;
         pr_default = new DataStoreProvider(context, new GeneXus.Programs.prcreuniao__default(),
            new Object[][] {
                new Object[] {
               }
               , new Object[] {
               P00063_A22ReuniaoId
               }
               , new Object[] {
               P00064_A23ReuniaoData, P00064_A27ReuniaoAssunto, P00064_A22ReuniaoId
               }
               , new Object[] {
               P00065_A22ReuniaoId, P00065_A30ReuniaoAtaFileName, P00065_A29ReuniaoAtaFileType, P00065_A27ReuniaoAssunto, P00065_A23ReuniaoData, P00065_A25ReuniaoLocal, P00065_A31ReuniaoNivel, P00065_A26ReuniaoObs, P00065_A24ReuniaoPalavra, P00065_A40ReuniaoUserCID,
               P00065_A28ReuniaoAta
               }
               , new Object[] {
               }
            }
         );
         /* GeneXus formulas. */
         context.Gx_err = 0;
      }

      private short AV16ReuniaoUserCID ;
      private short A40ReuniaoUserCID ;
      private int AV11ReuniaoId ;
      private int AV17AuxReuniaoId ;
      private int GX_INS2 ;
      private int A22ReuniaoId ;
      private String scmdbuf ;
      private String Gx_emsg ;
      private DateTime AV10ReuniaoData ;
      private DateTime A23ReuniaoData ;
      private bool n22ReuniaoId ;
      private String AV8ReuniaoAssunto ;
      private String AV12ReuniaoLocal ;
      private String AV13ReuniaoNivel ;
      private String AV14ReuniaoObs ;
      private String AV15ReuniaoPalavra ;
      private String A27ReuniaoAssunto ;
      private String A25ReuniaoLocal ;
      private String A31ReuniaoNivel ;
      private String A26ReuniaoObs ;
      private String A24ReuniaoPalavra ;
      private String A30ReuniaoAtaFileName ;
      private String A29ReuniaoAtaFileType ;
      private String AV9ReuniaoAta ;
      private String A28ReuniaoAta ;
      private IGxDataStore dsDefault ;
      private String aP0_ReuniaoAssunto ;
      private String aP1_ReuniaoAta ;
      private DateTime aP2_ReuniaoData ;
      private int aP3_ReuniaoId ;
      private String aP4_ReuniaoLocal ;
      private String aP5_ReuniaoNivel ;
      private String aP6_ReuniaoObs ;
      private String aP7_ReuniaoPalavra ;
      private short aP8_ReuniaoUserCID ;
      private IDataStoreProvider pr_default ;
      private int[] P00063_A22ReuniaoId ;
      private bool[] P00063_n22ReuniaoId ;
      private DateTime[] P00064_A23ReuniaoData ;
      private String[] P00064_A27ReuniaoAssunto ;
      private int[] P00064_A22ReuniaoId ;
      private bool[] P00064_n22ReuniaoId ;
      private int[] P00065_A22ReuniaoId ;
      private bool[] P00065_n22ReuniaoId ;
      private String[] P00065_A30ReuniaoAtaFileName ;
      private String[] P00065_A29ReuniaoAtaFileType ;
      private String[] P00065_A27ReuniaoAssunto ;
      private DateTime[] P00065_A23ReuniaoData ;
      private String[] P00065_A25ReuniaoLocal ;
      private String[] P00065_A31ReuniaoNivel ;
      private String[] P00065_A26ReuniaoObs ;
      private String[] P00065_A24ReuniaoPalavra ;
      private short[] P00065_A40ReuniaoUserCID ;
      private String[] P00065_A28ReuniaoAta ;
      private int aP9_AuxReuniaoId ;
   }

   public class prcreuniao__default : DataStoreHelperBase, IDataStoreHelper
   {
      public ICursor[] getCursors( )
      {
         cursorDefinitions();
         return new Cursor[] {
          new UpdateCursor(def[0])
         ,new ForEachCursor(def[1])
         ,new ForEachCursor(def[2])
         ,new ForEachCursor(def[3])
         ,new UpdateCursor(def[4])
       };
    }

    private static CursorDef[] def;
    private void cursorDefinitions( )
    {
       if ( def == null )
       {
          Object[] prmP00062 ;
          prmP00062 = new Object[] {
          new Object[] {"@ReuniaoData",SqlDbType.DateTime,8,0} ,
          new Object[] {"@ReuniaoPalavra",SqlDbType.VarChar,50,0} ,
          new Object[] {"@ReuniaoLocal",SqlDbType.VarChar,200,0} ,
          new Object[] {"@ReuniaoObs",SqlDbType.VarChar,400,0} ,
          new Object[] {"@ReuniaoUserCID",SqlDbType.SmallInt,4,0} ,
          new Object[] {"@ReuniaoAssunto",SqlDbType.VarChar,100,0} ,
          new Object[] {"@ReuniaoAta",SqlDbType.VarBinary,1024,0} ,
          new Object[] {"@ReuniaoNivel",SqlDbType.VarChar,50,0} ,
          new Object[] {"@ReuniaoAtaFileName",SqlDbType.VarChar,100,0} ,
          new Object[] {"@ReuniaoAtaFileType",SqlDbType.VarChar,100,0}
          } ;
          Object[] prmP00063 ;
          prmP00063 = new Object[] {
          } ;
          Object[] prmP00064 ;
          prmP00064 = new Object[] {
          new Object[] {"@AV8ReuniaoAssunto",SqlDbType.VarChar,100,0} ,
          new Object[] {"@AV10ReuniaoData",SqlDbType.DateTime,8,0}
          } ;
          Object[] prmP00065 ;
          prmP00065 = new Object[] {
          new Object[] {"@AV11ReuniaoId",SqlDbType.Int,5,0}
          } ;
          Object[] prmP00066 ;
          prmP00066 = new Object[] {
          new Object[] {"@ReuniaoAssunto",SqlDbType.VarChar,100,0} ,
          new Object[] {"@ReuniaoAta",SqlDbType.VarBinary,1024,0} ,
          new Object[] {"@ReuniaoData",SqlDbType.DateTime,8,0} ,
          new Object[] {"@ReuniaoLocal",SqlDbType.VarChar,200,0} ,
          new Object[] {"@ReuniaoNivel",SqlDbType.VarChar,50,0} ,
          new Object[] {"@ReuniaoObs",SqlDbType.VarChar,400,0} ,
          new Object[] {"@ReuniaoPalavra",SqlDbType.VarChar,50,0} ,
          new Object[] {"@ReuniaoUserCID",SqlDbType.SmallInt,4,0} ,
          new Object[] {"@ReuniaoAtaFileType",SqlDbType.VarChar,100,0} ,
          new Object[] {"@ReuniaoAtaFileName",SqlDbType.VarChar,100,0} ,
          new Object[] {"@ReuniaoId",SqlDbType.Int,5,0}
          } ;
          def= new CursorDef[] {
              new CursorDef("P00062", "INSERT INTO [TBLReuniao] ([ReuniaoData], [ReuniaoPalavra], [ReuniaoLocal], [ReuniaoObs], [ReuniaoUserCID], [ReuniaoAssunto], [ReuniaoAta], [ReuniaoNivel], [ReuniaoAtaFileName], [ReuniaoAtaFileType]) VALUES (@ReuniaoData, @ReuniaoPalavra, @ReuniaoLocal, @ReuniaoObs, @ReuniaoUserCID, @ReuniaoAssunto, @ReuniaoAta, @ReuniaoNivel, @ReuniaoAtaFileName, @ReuniaoAtaFileType)", GxErrorMask.GX_NOMASK,prmP00062)
             ,new CursorDef("P00063", "SELECT Ident_Current('[TBLReuniao]') ",false, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmP00063,1,0,true,false )
             ,new CursorDef("P00064", "SELECT [ReuniaoData], [ReuniaoAssunto], [ReuniaoId] FROM [TBLReuniao] WITH (NOLOCK) WHERE ([ReuniaoAssunto] = @AV8ReuniaoAssunto) AND ([ReuniaoData] = @AV10ReuniaoData) ORDER BY [ReuniaoId] ",false, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmP00064,100,0,false,false )
             ,new CursorDef("P00065", "SELECT [ReuniaoId], [ReuniaoAtaFileName], [ReuniaoAtaFileType], [ReuniaoAssunto], [ReuniaoData], [ReuniaoLocal], [ReuniaoNivel], [ReuniaoObs], [ReuniaoPalavra], [ReuniaoUserCID], [ReuniaoAta] FROM [TBLReuniao] WITH (UPDLOCK) WHERE [ReuniaoId] = @AV11ReuniaoId ORDER BY [ReuniaoId] ",true, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmP00065,1,0,true,true )
             ,new CursorDef("P00066", "UPDATE [TBLReuniao] SET [ReuniaoAssunto]=@ReuniaoAssunto, [ReuniaoAta]=@ReuniaoAta, [ReuniaoData]=@ReuniaoData, [ReuniaoLocal]=@ReuniaoLocal, [ReuniaoNivel]=@ReuniaoNivel, [ReuniaoObs]=@ReuniaoObs, [ReuniaoPalavra]=@ReuniaoPalavra, [ReuniaoUserCID]=@ReuniaoUserCID, [ReuniaoAtaFileType]=@ReuniaoAtaFileType, [ReuniaoAtaFileName]=@ReuniaoAtaFileName  WHERE [ReuniaoId] = @ReuniaoId", GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK,prmP00066)
          };
       }
    }

    public void getResults( int cursor ,
                            IFieldGetter rslt ,
                            Object[] buf )
    {
       switch ( cursor )
       {
             case 1 :
                ((int[]) buf[0])[0] = rslt.getInt(1) ;
                break;
             case 2 :
                ((DateTime[]) buf[0])[0] = rslt.getGXDate(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((int[]) buf[2])[0] = rslt.getInt(3) ;
                break;
             case 3 :
                ((int[]) buf[0])[0] = rslt.getInt(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((String[]) buf[2])[0] = rslt.getVarchar(3) ;
                ((String[]) buf[3])[0] = rslt.getVarchar(4) ;
                ((DateTime[]) buf[4])[0] = rslt.getGXDate(5) ;
                ((String[]) buf[5])[0] = rslt.getVarchar(6) ;
                ((String[]) buf[6])[0] = rslt.getVarchar(7) ;
                ((String[]) buf[7])[0] = rslt.getVarchar(8) ;
                ((String[]) buf[8])[0] = rslt.getVarchar(9) ;
                ((short[]) buf[9])[0] = rslt.getShort(10) ;
                ((String[]) buf[10])[0] = rslt.getBLOBFile(11, rslt.getVarchar(3), rslt.getVarchar(2)) ;
                break;
       }
    }

    public void setParameters( int cursor ,
                               IFieldSetter stmt ,
                               Object[] parms )
    {
       switch ( cursor )
       {
             case 0 :
                stmt.SetParameter(1, (DateTime)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (String)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (short)parms[4]);
                stmt.SetParameter(6, (String)parms[5]);
                stmt.SetParameter(7, (String)parms[6]);
                stmt.SetParameter(8, (String)parms[7]);
                stmt.SetParameter(9, (String)parms[8]);
                stmt.SetParameter(10, (String)parms[9]);
                break;
             case 2 :
                stmt.SetParameter(1, (String)parms[0]);
                stmt.SetParameter(2, (DateTime)parms[1]);
                break;
             case 3 :
                stmt.SetParameter(1, (int)parms[0]);
                break;
             case 4 :
                stmt.SetParameter(1, (String)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (DateTime)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (String)parms[4]);
                stmt.SetParameter(6, (String)parms[5]);
                stmt.SetParameter(7, (String)parms[6]);
                stmt.SetParameter(8, (short)parms[7]);
                stmt.SetParameter(9, (String)parms[8]);
                stmt.SetParameter(10, (String)parms[9]);
                if ( (bool)parms[10] )
                {
                   stmt.setNull( 11 , SqlDbType.Int );
                }
                else
                {
                   stmt.SetParameter(11, (int)parms[11]);
                }
                break;
       }
    }

 }

}
